Ext.define('appfe.view.main.MainModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.main',

    data: {
        currentView: null,
        name: 'myAppName',
        headerTip: '全局消息提示',
        clockTip: '2021-01-19 10:30:29',
        // 系统信息
        system: {
            name: '热配置系统',
            en_name: 'HotConfig',
            //version: version,
            iconUrl: 'resources/images/logo.svg'
        },

        // 用户单位信息和用户信息
        user: {
            company: '北京聚商宝科技有限公司',
            department: '技术部',
            username: '游客',
            displayname: '游客'
        },

        // 服务单位和服务人员信息
        service: {
            company: '聚商宝®',
            name: '中海云泽',
            tel: '13205280000',
            // qq : '78580822',
            email: 'zhangjifeng@zinbiz.com',
            copyright: '精商™'
        }
    },

    formulas: {
        selectionText: function (get) {
            var selection = get('navTreeList.selection');//moduleNavTreePanel
            var path;
            if (selection) {
                path = selection.getPath('text');
                path = path.replace(/^\/Root/, '');
                return 'Selected: ' + path;
            } else {
                return 'No node selected';
            }
        },
        versionText: {
            get: function (data) {
                if (typeof (sys_version) === 'undefined') {
                    return '版本号:---'
                } else {
                    return '版本号:' + sys_version
                }

            }
        }
    }
});